package demo01;

public class Body {//外部类

    public class Heart{//内部类
        public void beat(){
            System.out.println("蹦蹦蹦");
            System.out.println(name);
        }
    }
    private String name;
    public void methodBody(){
        System.out.println("外部类方法");
        new Heart().beat();
    }

    public Body(){}
    public Body(String name) {
        this.name = name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }
}
